# -*- coding: UTF-8 -*-
# Author: Damon(wuud1)
# CreateDate:
# Message:


# a = []
# b = ['b']
#
# if a:
#     print 'a'
# if b:
#     print 'b'

import redis


# 更完善的redis断点续爬思路, 不会产生数据遗漏
r = redis.Redis()
rp = r.pipeline()
try:

    rp.sadd('test_set', 'test2')

    # raise Exception("test_error")

except Exception as e:
    # rp.reset()
    raise e
rp.execute()

# print dir(rp)

rp.sismember('test_set', 'test2')
a = rp.execute()[0]
print a



# if rp.sismember('test_set', 'test24'):
#     print 'xxx'
# print a.RESPONSE_CALLBACKS
# print a

